Nub is an all-in-one toolkit for Node.js, written in Rust. One binary runs your TypeScript files and scripts, installs your dependencies, and provisions Node itself — replacing node, npm/pnpm, npx, and nvm without adopting a new runtime.

npm install -g --ignore-scripts=false @nubjs/nub
nub index.ts             # run a TypeScript file
nub install              # install dependencies (pnpm-compatible)
nub run dev              # run a package.json script
nubx prisma generate     # run a CLI from node_modules/.bin

There is no new runtime to adopt and no lock-in: every augmentation rides on Node's own public extension surfaces, and the package manager reads and writes whatever lockfile your project already uses.

The toolkit

  • A runtime — execute .{js,cjs,mjs,jsx,ts,cts,mts,tsx} files with full TypeScript support, on the stock node binary. See files.
  • A package manager — a pnpm-compatible installer that round-trips your existing npm, pnpm, or bun lockfile. See install.
  • A script runner — run package.json scripts 24× faster than pnpm run, with the full workspace and lifecycle-hook surface preserved. See run.
  • A bin runner — run a local CLI an order of magnitude faster than npx, or fetch and run an uninstalled one from the registry. See nubx.
  • A Node version manager — pin a version and Nub provisions it from nodejs.org on demand, replacing nvm and fnm. See node.
  • A watcher — restart on changes to your source, your .env* files, and your tsconfig.json, driven by the dependency graph. See watch.
  • A GitHub Action — swap actions/setup-node for nubjs/setup-nub to install Nub, warm the project's Node, and cache Nub's store in CI. See GitHub Action.

What Nub replaces

NubInstead of
nub <file>node, tsx, ts-node, dotenv-cli
nub run <script>npm run, pnpm run, yarn run
nubxnpx, pnpm dlx, pnpm exec, yarn dlx
nub installnpm, pnpm, yarn
nub watchnodemon, node --watch, tsx watch
nub nodenvm, fnm, n, volta
nub pmcorepack

Install

npm install -g --ignore-scripts=false @nubjs/nub

Both pnpm add -g @nubjs/nub and yarn global add @nubjs/nub work equivalently. That installs the Rust binary plus the platform-specific N-API addons, and puts nub and nubx on your PATH. On macOS and Linux, Homebrew works too:

brew install nubjs/tap/nub

For containers, the official image ghcr.io/nubjs/nub is a node base with Nub layered on. See Docker:

FROM ghcr.io/nubjs/nub

In CI, swap actions/setup-node for the setup-nub action:

- - uses: actions/setup-node@v4
+ - uses: nubjs/setup-nub@v0

Package management

The installer is pnpm-compatible at the CLI surface and lockfile-compatible with whatever your project already uses. It infers the incumbent package manager and mirrors it — npm, pnpm, and bun lockfiles round-trip cleanly; yarn is read-only.

nub install              # resolve + link node_modules into the existing lockfile
nub add -E -D react      # exact pin, devDeps — pnpm flag spelling
nub remove lodash
nub update
nub ci                   # frozen-lockfile install

It's optional: keep running your existing package manager and reach for Nub for everything else. See install for lockfile fidelity per incumbent, and pm for provisioning the exact package-manager version a project pins.

Requirements

  • Node 18.19+ (Node 18 LTS) for augmented modes.
  • macOS (arm64, x64), Linux (x64, arm64), Windows (x64, arm64).

Where to next

  • Quick answers: the FAQ.